package cn.lutu.lutu.service.impl;

import cn.lutu.lutu.mapper.CommentMapper;
import cn.lutu.lutu.pojo.dto.CommentPostDTO;
import cn.lutu.lutu.pojo.entity.Comment;
import cn.lutu.lutu.pojo.entity.User;
import cn.lutu.lutu.pojo.vo.UserVO;
import cn.lutu.lutu.security.CustomUserDetails;
import cn.lutu.lutu.service.CommentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
@Slf4j
@Service
public class CommentServiceImpl implements CommentService {
    @Autowired
    CommentMapper commentMapper;
    @Override
    public Comment insert(CommentPostDTO commentPostDTO, CustomUserDetails cud) {
        log.debug("commentPostDTO="+commentPostDTO+";cud="+cud);
        Comment comment = new Comment();
        BeanUtils.copyProperties(commentPostDTO,comment);
        comment.setCreateTime(new Date());
        comment.setUserId(1L);
        return comment;
    }
}
